Skip to content

Conversation

@XiaoMigros
Copy link
Contributor

Tested with following test code (when creating a blank grand staff score, hides the bottom staff of the first system):

import QtQuick 2.0
import MuseScore 3.0

MuseScore {
    title: qsTr("Hide staff if empty")
    description: qsTr("test")

    onRun: {
        try {
			curScore.startCmd("Hide staff if empty")
            curScore.systems[1].setHideStaffIfEmpty(1, AutoOnOff.ON)
            curScore.endCmd()
        } catch (e) {
            // If we encounter an error, rollback all changes
            curScore.endCmd(true)
            curScore.startCmd("Error: " + e.toString())
            var text = newElement(Element.STAFF_TEXT)
            text.text = e.toString()
            var c = curScore.newCursor()
            c.rewind(Cursor.SCORE_START)
            c.track = 0
            c.add(text)
            curScore.endCmd()
        }
        quit()
    }
}

  • I signed the CLA
  • The title of the PR describes the problem it addresses
  • Each commit's message describes its purpose and effects, and references the issue it resolves
  • If changes are extensive, there is a sequence of easily reviewable commits
  • The code in the PR follows the coding rules
  • There are no unnecessary changes
  • The code compiles and runs on my machine, preferably after each commit individually
  • I created a unit test or vtest to verify the changes I made (if applicable)

@cbjeukendrup cbjeukendrup merged commit 53a5bb1 into musescore:master Oct 20, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants